Optimal. Leaf size=121 \[ \frac {c^3 (A+4 i B) \tan (e+f x)}{a f}-\frac {4 c^3 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac {4 c^3 (-2 B+i A) \log (\cos (e+f x))}{a f}-\frac {4 c^3 x (A+2 i B)}{a}+\frac {B c^3 \tan ^2(e+f x)}{2 a f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.18, antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3588, 77} \[ \frac {c^3 (A+4 i B) \tan (e+f x)}{a f}-\frac {4 c^3 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac {4 c^3 (-2 B+i A) \log (\cos (e+f x))}{a f}-\frac {4 c^3 x (A+2 i B)}{a}+\frac {B c^3 \tan ^2(e+f x)}{2 a f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 77
Rule 3588
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {(A+B x) (c-i c x)^2}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (\frac {(A+4 i B) c^2}{a^2}+\frac {B c^2 x}{a^2}-\frac {4 (A+i B) c^2}{a^2 (-i+x)^2}+\frac {4 i (A+2 i B) c^2}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {4 (A+2 i B) c^3 x}{a}-\frac {4 (i A-2 B) c^3 \log (\cos (e+f x))}{a f}-\frac {4 (A+i B) c^3}{a f (i-\tan (e+f x))}+\frac {(A+4 i B) c^3 \tan (e+f x)}{a f}+\frac {B c^3 \tan ^2(e+f x)}{2 a f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 6.20, size = 212, normalized size = 1.75 \[ \frac {c^3 (\cos (f x)+i \sin (f x)) (A+B \tan (e+f x)) \left (4 (A+i B) (\sin (e)+i \cos (e)) \cos (2 f x)+4 (A+i B) (\cos (e)-i \sin (e)) \sin (2 f x)+4 (2 B-i A) (\cos (e)+i \sin (e)) \log \left (\cos ^2(e+f x)\right )-8 (A+2 i B) (\cos (e)+i \sin (e)) \tan ^{-1}(\tan (f x))+2 (A+4 i B) (1+i \tan (e)) \sin (f x) \sec (e+f x)+B (\cos (e)+i \sin (e)) \sec ^2(e+f x)\right )}{2 f (a+i a \tan (e+f x)) (A \cos (e+f x)+B \sin (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.53, size = 221, normalized size = 1.83 \[ -\frac {8 \, {\left (A + 2 i \, B\right )} c^{3} f x e^{\left (6 i \, f x + 6 i \, e\right )} - {\left (2 i \, A - 2 \, B\right )} c^{3} + {\left (16 \, {\left (A + 2 i \, B\right )} c^{3} f x - {\left (4 i \, A - 8 \, B\right )} c^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (8 \, {\left (A + 2 i \, B\right )} c^{3} f x - {\left (6 i \, A - 12 \, B\right )} c^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - {\left ({\left (-4 i \, A + 8 \, B\right )} c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-8 i \, A + 16 \, B\right )} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-4 i \, A + 8 \, B\right )} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{a f e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.79, size = 321, normalized size = 2.65 \[ -\frac {2 \, {\left (\frac {{\left (2 i \, A c^{3} - 4 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a} - \frac {{\left (4 i \, A c^{3} - 8 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a} - \frac {{\left (-2 i \, A c^{3} + 4 \, B c^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a} + \frac {5 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 8 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2 i \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 7 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 10 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 14 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2 i \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 7 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 5 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 8 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - i \, \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{2} a}\right )}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.19, size = 150, normalized size = 1.24 \[ \frac {c^{3} A \tan \left (f x +e \right )}{f a}+\frac {4 i c^{3} B \tan \left (f x +e \right )}{f a}+\frac {B \,c^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2 a f}+\frac {4 i c^{3} B}{f a \left (\tan \left (f x +e \right )-i\right )}+\frac {4 c^{3} A}{f a \left (\tan \left (f x +e \right )-i\right )}+\frac {4 i c^{3} A \ln \left (\tan \left (f x +e \right )-i\right )}{f a}-\frac {8 c^{3} B \ln \left (\tan \left (f x +e \right )-i\right )}{f a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.70, size = 136, normalized size = 1.12 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-\frac {8\,B\,c^3}{a}+\frac {A\,c^3\,4{}\mathrm {i}}{a}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {c^3\,\left (A+B\,2{}\mathrm {i}\right )}{a}+\frac {B\,c^3\,2{}\mathrm {i}}{a}\right )}{f}+\frac {\frac {4\,B\,c^3}{a}+\frac {\left (4\,A\,c^3+B\,c^3\,8{}\mathrm {i}\right )\,1{}\mathrm {i}}{a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}+\frac {B\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,a\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.95, size = 269, normalized size = 2.22 \[ \frac {- 2 i A c^{3} + 8 B c^{3} + \left (- 2 i A c^{3} e^{2 i e} + 6 B c^{3} e^{2 i e}\right ) e^{2 i f x}}{- a f e^{4 i e} e^{4 i f x} - 2 a f e^{2 i e} e^{2 i f x} - a f} + \begin {cases} - \frac {\left (- 2 i A c^{3} + 2 B c^{3}\right ) e^{- 2 i e} e^{- 2 i f x}}{a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (- \frac {- 8 A c^{3} - 16 i B c^{3}}{a} + \frac {i \left (8 i A c^{3} e^{2 i e} - 4 i A c^{3} - 16 B c^{3} e^{2 i e} + 4 B c^{3}\right ) e^{- 2 i e}}{a}\right ) & \text {otherwise} \end {cases} - \frac {4 i c^{3} \left (A + 2 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} - \frac {x \left (8 A c^{3} + 16 i B c^{3}\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________